﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="memberprofile.aspx.vb"
    Inherits="HauntedNetworkingSite.memberprofile" %>

<%@ Register Src="Banner.ascx" TagName="Banner" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Member Profile</title>
    <link href="StyleSheet2.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            width: 100%;
            
        }
        .style2
        {
            width: 200px;
            height: 400px;
        }
        .style3
        {
            height: 10%;
            width: 200px;
        }
        .style4
        {
            height: 147px;
        }
        .style5
        {
            height: 400px;
            width: 20%;
        }
        .style6
        {
            height: 400px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <uc1:Banner ID="Banner1" runat="server" />
        <h1>
            &nbsp;</h1>
        <h1 class="style1">
            &nbsp;</h1>
        <br />
        <table class="style1">
            <tr >
                <td class="style2" valign="top">
    <asp:FormView ID="FormView1" runat="server" 
        DataSourceID="ProfileImageDataSource">
        <EditItemTemplate>
            ProfileImage:
            <asp:TextBox ID="ProfileImageTextBox" runat="server" 
                Text='<%# Bind("ProfileImage") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            ProfileImage:
            <asp:TextBox ID="ProfileImageTextBox0" runat="server" 
                Text='<%# Bind("ProfileImage") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            <asp:Image ID="Image2" runat="server" Height="250px" 
                ImageUrl='<%# Eval("ProfileImage") %>' Width="200px" />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label>
            <br />
            <asp:Label ID="Label2" runat="server" Text='<%# Eval("Age") %>'></asp:Label>
            <br />
            <asp:Label ID="Label3" runat="server" Text='<%# Eval("Gender") %>'></asp:Label>
            <br />
            <asp:Label ID="Label4" runat="server" Text='<%# Eval("City") %>'></asp:Label>
            <br />
            <asp:Label ID="Label5" runat="server" Text='<%# Eval("Country") %>'></asp:Label>
            <br />
        </ItemTemplate>
        <EmptyDataTemplate>
            You haven&#39;t added your details yet.<br />
            <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/EditProfile.aspx">Click 
            here to edit your profile</asp:HyperLink>
        </EmptyDataTemplate>
    </asp:FormView>
    <asp:SqlDataSource ID="ProfileImageDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
        
                        SelectCommand="SELECT [ProfileImage], [FirstName], [LastName], [Age], [Gender], [City], [Country], [UserName] FROM [UserInformation] WHERE ([UserName] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="UserName" QueryStringField="UserName" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
                </td>
                <td valign="top" class="style5" align="center">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <br />
                    <br />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <br />
                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="ID"
                        DataSourceID="DetailedUserInformationDataSource" Height="50px" Width="60%" GridLines="None"
                        RowStyle-HorizontalAlign="Left" FieldHeaderStyle-CssClass="titleclass">
                        <RowStyle HorizontalAlign="Left" />
                        <FieldHeaderStyle CssClass="titleclass" />
                        <EmptyDataTemplate>
                            You haven&#39;t added your details yet.<br />
                            <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/EditProfile.aspx">Click 
                            here to edit your profile</asp:HyperLink>
                        </EmptyDataTemplate>
                        <Fields>
                            <asp:BoundField DataField="BirthDate" HeaderText="Birth Date" SortExpression="BirthDate">
                                <ItemStyle Width="85%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="AboutMe" HeaderText="About Me" SortExpression="AboutMe" />
                            <asp:BoundField DataField="Interests" HeaderText="Interests" SortExpression="Interests" />
                            <asp:BoundField DataField="EMailAddress" HeaderText="Email Address" SortExpression="EMailAddress" />
                            <asp:BoundField DataField="ProfileComments" HeaderText="Profile Comments" SortExpression="ProfileComments" />
                        </Fields>
                    </asp:DetailsView>
                    <asp:SqlDataSource ID="DetailedUserInformationDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>"
                        ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" SelectCommand="SELECT * FROM [UserInformation] WHERE ([UserName] = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="UserName" QueryStringField="UserName" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource></td>
                <td valign="top" class="style6">
                    <asp:PlaceHolder ID="PlaceHolder_MyImages" runat="server"></asp:PlaceHolder>
                    <br />
                    <asp:PlaceHolder ID="PlaceHolder_MyGroups" runat="server"></asp:PlaceHolder>
                    <br />
                    <asp:PlaceHolder ID="PlaceHolder_myLocations" runat="server"></asp:PlaceHolder>
                    <br />
                    <asp:PlaceHolder ID="PlaceHolder_myDiscussions" runat="server">
                    </asp:PlaceHolder>
                    <br />
                    <asp:HyperLink ID="HyperLink_EditProfile" runat="server" Font-Size="1.2em" 
                        ForeColor="Red" NavigateUrl="~/EditProfile.aspx">Edit Profile</asp:HyperLink>
                    </td>
            </tr>
            <tr>
                <td class="style3">
                    <br />
                    <h2 class="titleclass">Groups</h2><br />
                    <asp:DataList ID="DataList1" runat="server" DataSourceID="MyGroupsDataSource" 
                        CssClass="gridclass" RepeatDirection="Horizontal">
                        <ItemTemplate>
                            <asp:Image ID="Image3" runat="server" ImageUrl='<%# Eval("GroupImage") %>' />
                            <br />
                            <asp:HyperLink ID="HyperLink1" runat="server" 
                                NavigateUrl='<%# Eval("ID", "GroupProfile.aspx?ID={0}") %>' 
                                Text='<%# Eval("GroupName") %>'></asp:HyperLink>
                            <br />
                            <br />
                        </ItemTemplate>
                    </asp:DataList>
                    <asp:SqlDataSource ID="MyGroupsDataSource" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
                        
                        SelectCommand="SELECT [GroupImage], [GroupName], [ID] FROM [groups] WHERE ([UserName] = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="UserName" QueryStringField="UserName" 
                                Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td class="style3" valign="top">
                    
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                        AutoGenerateColumns="False" DataSourceID="MyDiscussionsDataSource" GridLines="Horizontal"
                        DataKeyNames="ID" Width="343px" HeaderStyle-CssClass="titleclass">
                        <Columns>
                            <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="DiscussionTopic.aspx?ID={0}"
                                DataTextField="Topic" HeaderText="Discussion Topics" />
                        </Columns>

                        <EmptyDataTemplate>
                            You haven&#39;t started any discussions yet.<br />
                            <asp:HyperLink ID="HyperLink4" runat="server" 
                                NavigateUrl="~/AddDiscussion.aspx">Click here to start a discussion.</asp:HyperLink>
                        </EmptyDataTemplate>

<HeaderStyle CssClass="titleclass"></HeaderStyle>
                    </asp:GridView>
                    <asp:SqlDataSource ID="MyDiscussionsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>"
                        ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" SelectCommand="SELECT [Topic], [Body], [ID] FROM [discussionforumQuery] WHERE ([StartedBy] = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="StartedBy" QueryStringField="UserName" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource></td>
                <td class="style4" valign="top">
                    
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style3" colspan="2" align="center">
                    <asp:Label ID="lbl_MyImages" runat="server" CssClass="titleclass" 
                        Text="Images" Font-Size="1.4em"></asp:Label>
                    <asp:DataList ID="DataList2" runat="server" DataSourceID="MyImagesDataSource" 
                        CssClass="myimages" RepeatColumns="3" RepeatDirection="Horizontal">
                        <ItemTemplate>
                            <asp:Image ID="Image1" runat="server" 
                                ImageUrl='<%# Eval("Picture", "{0}") %>' />
                            <br />
                            <asp:Label ID="PictureNameLabel" runat="server" 
                                Text='<%# Eval("PictureName") %>' />
                            <br />
                            <br />
                        </ItemTemplate>
                    </asp:DataList>
                    <asp:SqlDataSource ID="MyImagesDataSource" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
                        SelectCommand="SELECT [Picture], [PictureName] FROM [UserUploadedImages] WHERE ([UserName] = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="UserName" QueryStringField="UserName" 
                                Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td class="style3" align="center">
                    &nbsp;</td>
            </tr>
        </table>
        <br />
        <br />
    </div>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <br />
    <br />
    </form>
</body>
</html>
